﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Xml;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControl_ControlMenu : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindXMLMenuParent();
            BindXMLProduct();
            BindXMLHealthCareMenu();
            BindXMLDistributor();
        }
    }
    void BindXMLMenuParent()
    {
        DataSet db = new DataSet();
        if (Session["lang"].ToString() == "vi-vn")
        {
            db.ReadXml(Server.MapPath("~/XML/MenuParentVN.xml"));
        }
        else
        {

        }

        rpt_MenuParent.DataSource = db;
        rpt_MenuParent.DataBind();


    }
    void BindXMLProduct()
    {
        DataSet db = new DataSet();
        if (Session["lang"].ToString() == "vi-vn")
        {
            db.ReadXml(Server.MapPath("~/XML/Products.xml"));
        }
        else
        {

        }

        rpt_Product.DataSource = db;
        rpt_Product.DataBind();
    }
    void BindXMLHealthCareMenu()
    {
        DataSet db = new DataSet();
        if (Session["lang"].ToString() == "vi-vn")
        {
            db.ReadXml(Server.MapPath("~/XML/MenuHealthCareVN.xml"));
        }
        else
        {
        }


        rpt_HealthMenu.DataSource = db;
        rpt_HealthMenu.DataBind();
    }
    void BindXMLDistributor()
    {
        
        DataSet db = new DataSet();
        if (Session["lang"].ToString() == "vi-vn")
        {
            db.ReadXml(Server.MapPath("~/XML/MenuDistributorVN.xml"));
        }
        else
        {

        }


        rpt_Distributor.DataSource = db;
        rpt_Distributor.DataBind();
    }
}